#size
res<-300
width<-500*res/72
height<-4/5*width

color<-c('gray80','gray45')
space<-c(0,2)#spaces between pairs of bars
border<-T
lwd_border<-0.5

#grid
lwd_grid<-0.5
color_grid<-"black"

#Data

South<-c(29,50,68,61, 7)
North<-c(17,28,33,39, 6)

#Export to tiff
tiff(filename = "figures_tables/Fig2_RightPanel_North.tif",
     width = width, 
     height =height,
     res=res,
     units = "px", 
     pointsize=9,
     bg = "white", 
     type = 'cairo')

par(mar=c(4,6,3,4)+0.1,lwd=lwd_border)

barplot(rbind(South, North), width=0.2, xlim=c(0,4.5), ylim=c(0,100),beside=T,
        col=color,,space=c(1.0,0,1.4,0,1.4,0,1.4,0,1.4,0))
        
abline(h=seq(0,100,20),col=color_grid,lwd=lwd_grid)
abline(h=0)
abline(h=100)

mtext(c('Lobbying', 'Bureaucratic \n Help', 'Monitoring \n & Oversight', 'Community \n Mobilization', 'Other'),side=1,line=2,at=c(0.3,1.0,1.7,2.4,3.1)+0.1)

barplot(rbind(South, North), width=0.2, xlim=c(0,4.5), ylim=c(0,100),beside=T,
        col=color,lwd=lwd_border,space=c(1.0,0,1.4,0,1.4,0,1.4,0,1.4,0),
        ylab='Percentage of politicians providing type of project support',add=T)


legend(0.05,100,
       legend=c('non-North','North'),
       fill=c('gray80','gray45'),
       bty='n'
)

dev.off()